package javaCode;

/**
 * Created by lxy_920912 on 03/05/2017.
 */
public class LeetCode520 {
    public boolean detectCapitalUse(String word) {
        if(word.matches("[A-Z]+")){
            return  true;
        } else if(word.matches("[a-z]+")){
            return true;
        } else if(word.matches("[A-Z]{1}[a-z]*")){
            return true;
        }else {
            return false;
        }
    }
}
